﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TopVisionVideoStream.Mananger
{
    public class LogoutManager : IDisposable
    {
        public event LogoutEventHandler LogoutEvent;

        public LogoutManager()
        {
            OcxApi.LogoutResultEvent += OcxApi_LogoutResultEvent;
        }

        public bool Logout()
        {
            return OcxApi.Logout();
        }

        private void OcxApi_LogoutResultEvent(object sender, EventArgs e)
        {
            LogoutEvent?.Invoke();
        }

        public void Dispose()
        {
            OcxApi.LogoutResultEvent -= OcxApi_LogoutResultEvent;
        }
    }
}
